//
//  ImageUtility.swift
//  NyamanDana
//
//  Created by 李永彬 on 2025/10/22.
//

import UIKit

enum ImageUtility {
    static func proportionalHeight(for imageName: String, targetWidth: CGFloat) -> CGFloat {
        guard let image = UIImage(named: imageName) else {
            debugPrint("Image not found: \(imageName)")
            return 0.0
        }
        
        return image.proportionalHeight(forWidth: targetWidth)
    }
    
    static func proportionalSize(for imageName: String, targetWidth: CGFloat) -> CGSize {
        guard let image = UIImage(named: imageName) else {
            debugPrint("Image not found: \(imageName)")
            return .zero
        }
        
        let height = image.proportionalHeight(forWidth: targetWidth)
        return CGSize(width: targetWidth, height: height)
    }
}

